#!/bin/sh

# done taking stills; restart the HTTP streamer
stream-start

# process the timelapse into a movie
cd /var/www/pics
ls -1tr *.jpg | grep -v files.txt > files.txt
mencoder -idx -nosound -noskip -ovc lavc -lavcopts \
				vcodec=mjpeg -o $$.avi -mf fps=15 'mf://@files.txt'
rm files.txt

# vid transcoding in the cloud:
ssh -i $HOME/.ssh/vidconvert jeff_allen@nella.org \
					bin/vidconvert < $$.avi

rm *.jpg $$.avi
